/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gla.centralhotel.dao.interfaces;

import gla.centralhotel.exception.AgencySubscriptionException;
import gla.centralhotel.exception.IllegalAuthenticationException;
import gla.centralhotel.exception.NoUserFoundException;
import gla.centralhotel.model.Agency;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author Rivo
 */
@Local
public interface IAgencyDAO {

//    Agency create(Agency agency);

    Agency edit(Agency agency);

    void remove(Agency agency);

    Agency find(Object id);

    List<Agency> findAll();
    
    /**
     * Identifie l'utilisateur (agence) par "login - password"
     * @param email
     * @param pwd
     * @return
     * @throws javax.persistence.NoResultException
     * @throws javax.persistence.NonUniqueResultException
     */
    public Agency findAgencyByEmailPassword(String email, String pwd) throws IllegalAuthenticationException;

    /**
     * Ajoute une agence d'hotel et vérifie l'unicité du mail (mot de passe implicite)
     * @param manager
     * @return
     */
    public Agency saveAgency(Agency agency) throws AgencySubscriptionException, IllegalAuthenticationException;
    
    /**
     * MAJ Infos manager d'hotel
     * @param manager
     * @return
     */
    public Agency updateAgency(Agency agency)throws AgencySubscriptionException, IllegalAuthenticationException, NoUserFoundException;

    public Agency findAgencyByLogin(String login) throws NoUserFoundException;

}
